Barva Pixelu Desktopu

Otázka od: Milos J. Hrach

21. 6. 2004 13:21

Nevite nekdo jak zjistit barvu pixelu obrazovky, nebo pripadne
ulozit celou obrazovku do obrazku. Diky

--
Milos J. Hrach, D6 profi, WinXP Home


Odpovedá: Vaclav Sykora

21. 6. 2004 15:56

Zdravim,

screenshot lze udelat takhle:


function GetScreenshot: TBitmap;
var
  DesktopDC: HDC;
  DesktopCanvas: TCanvas;
  DesktopRect: TRect;

  bmp: TBitmap;
begin
  DesktopDC:= GetWindowDC(GetDeskTopWindow);
  DesktopCanvas:= TCanvas.Create;
  DesktopCanvas.Handle:= DesktopDC;
  DesktopRect:= Rect(0, 0, Screen.Width, Screen.Height);

  bmp:= TBitmap.Create;
  bmp.Height:= Screen.Height;
  bmp.Width:= Screen.Width;
  bmp.Canvas.CopyRect(DesktopRect, DesktopCanvas, DesktopRect);

  Result:= bmp;

  ReleaseDC(GetDesktopWindow, DesktopDC);
end;

> -----Original Message-----
> From: delphi-l-owner@clexpert.cz
> [mailto:delphi-l-owner@clexpert.cz] On Behalf Of Milos J. Hrach
> Sent: Monday, June 21, 2004 2:14 PM
> To: delphi-l@clexpert.cz
> Subject: Barva Pixelu Desktopu
>
>
> Nevite nekdo jak zjistit barvu pixelu obrazovky, nebo
> pripadne ulozit celou obrazovku do obrazku. Diky
>
> --
> Milos J. Hrach, D6 profi, WinXP Home
>
>
>
>
>